﻿using System;
using Super_Management_Mayhem.Content.Animations;
using Super_Management_Mayhem.Content.Animations.Manager;
using Transformable_Engine_v2.Engine.Animation.FrameAnimation;
using Transformable_Engine_v2.Engine.Animation.PositionAnimation;
using Transformable_Engine_v2.Engine.Animation.Trajectory;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.Players.Manager
{
    public partial class Manager
    {
        private TE_Vector2 _fallDirection;
        private TE_Rectangle _hole;

        private void HandleKeyPressFallState(Input input) {}

        private void HandleKeyReleaseFallState(Input input) {}

        private void InitializeFallState()
        {
            if(_isCarrying)
                DestroyCarriedObject();

            _player.ClearAnimation<PositionUniformLinearAnimation>();
            SetFallModel();

            _shadow.Visible = false;
            _tileIndicator.Visible = false;

            _player.AddAnimations(new PositionAnimation(new LinearEasing(), _fallDirection.AsGridBound(), 1500, false, 0));

            CallMethod(1000, KillPlayer);
        }

        void KillPlayer()
        {
            _statistics.LoseAllLife(_hole);
            Die();
        }

        private void UpdateFallState(TimeSpan gameTime) {}
    }
}